#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-

# @Time    :2023/05/27 21:17:58
# @Author  :wakeblade (2390245#qq.com) 
# @version :8.1

"""
normal.py -- 采用注解方式
"""

# 解决无法找到项目根目录的问题
import sys, os
sys.path.append(os.path.dirname(os.path.dirname(__file__)))

from pathlib import Path

from fasttq import RedisClient, Broker

client = RedisClient("scan")
fq = Broker(client)

@fq.register(topic="parse")
def parse(path:str):
    print(Path(path).parts)
    return Path(path).parts

@fq.jobs(topic="parse", root="C:\\", pattern="*")
def scan(root:str, pattern:str):
    return Path(root).glob(pattern)

if __name__ == "__main__":
    fq.start()
